import os
import  time
import  sendbir 

userPro=open('whobir.txt',mode='r',encoding='utf-8')
names=[]
birs=[]
bir_name=[]
bir_bir=[]

for line in userPro:
    content = line.split('*',1)
    names.append(content[0])
    birs.append(content[1])

localtime=time.localtime(time.time())
month=localtime.tm_mon
if month<10 :
    monthstr='0'+str(month)
else:
    monthstr=str(month)
day=localtime.tm_mday
print(monthstr,day)

for i in range(len(names)):
    if monthstr==birs[i][0:2]:
        if (int(birs[i][2:])-day)==1 :
            print(names[i],birs[i])
            bir_name.append(names[i])
            bir_bir.append(birs[i])
            
if len(bir_name)!=0:   
    sendbir.sendmes(bir_name, bir_bir)


